package com.test.context.bdpp;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @Title:
 * @Description: 功能概述:
 * @Author: lihaiyang
 * @version: 1.0 .
 * @Date: 2022-07-15 14:26
 * @Copyright: Copyright(c)2022 RedaFlight.comAll Rights Reserved
 */
@Slf4j(topic = "e")
@Component
public class D implements BeanDefinitionRegistryPostProcessor {


	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		log.debug("d-c scan BeanDefinitionRegistryPostProcessor postProcessBeanFactory");
	}

	@Override
	public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
		log.debug("d-c scan BeanDefinitionRegistryPostProcessor postProcessBeanDefinitionRegistry");
		BeanDefinitionBuilder eBeanDefinitionBuilder = BeanDefinitionBuilder.genericBeanDefinition(E.class);
		registry.registerBeanDefinition("e", eBeanDefinitionBuilder.getBeanDefinition());

		BeanDefinitionBuilder fBeanDefinitionBuilder = BeanDefinitionBuilder.genericBeanDefinition(F.class);
		registry.registerBeanDefinition("f", fBeanDefinitionBuilder.getBeanDefinition());
	}
}
